package com.example.demo.modules.wiki.servceImp;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.modules.wiki.entity.Story;
import com.example.demo.modules.wiki.mapper.StoryMapper;
import com.example.demo.modules.wiki.service.StoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class StoryServiceImpl extends ServiceImpl<StoryMapper, Story> implements StoryService {

    @Autowired
    private StoryMapper storyMapper;

    //查询所有
    @Override
    public List<Story> listAll() {
        List<Story> storys = this.list();
        return storys;
    }

    //条件查询
    @Override
    public Story listOne(Long id) {
        Story story = this.getById(id);
        return story;
    }

    //保存
    @Override
    public int insert(Story story){
        return storyMapper.insert(story);

    }

}